﻿using System;
using System.Linq.Expressions;

namespace SapaFinance.Domain.Specifications.Obsolete
{
    public class AdHocSpecification<T> : Specification<T>
    {
        private readonly Expression<Func<T, bool>> specification;

        public AdHocSpecification(Expression<Func<T, bool>> specification)
        {
            this.specification = specification;
        }

        public override Expression<Func<T, bool>> IsSatisfiedBy()
        {
            //if (string.IsNullOrEmpty(text))
            //{
            //    return Expression.Lambda(Expression.Constant(true), parameter);
            //}
            return specification;
        }
    }
}